/**
 * @author zhouzhiheng98@foxmail.com 2020-07-23 17:17:52
 */
public class ConstructionMethod {
    public static void main(String[] args) {
        //自动匹配到构造方法public Person(String, int)
        ConstructionPerson p = new ConstructionPerson("Xiao Ming", 15);
        //自动匹配到构造方法public Person(String)
        ConstructionPerson p1 = new ConstructionPerson("Xiao Ming");
        //自动匹配到构造方法public Person()
        ConstructionPerson p2 = new ConstructionPerson();
        System.out.println(p.getName()+p.getAge());
        System.out.println(p1.getName()+p1.getAge());
        System.out.println(p2.getName()+p2.getAge());
    }
}
